export default {
    namespaced: true,
    // 记录数据
    state: {
        searchRes: [], // 搜索结果
        sortData: [], // 分类数据
        isNull: true, // 判断输入框是否为空
    },
    getters: {},
    // 修改数据
    mutations: {
        setSearchRes(state, value) {
            state.searchRes = value;
        },
        setSortData(state, value) {
            state.sortData = value;
        },
        setIsNull(state, value) {
            state.isNull = value;
        },
    },
    // 提交要修改的数据
    actions: {
        setSearchResAsync(content, value) {
            content.commit('setSearchRes', value)
        },
        setSortDataAsync(content, value) {
            content.commit('setSortData', value)
        },
        setIsNullAsync(content, value) {
            content.commit('setIsNull', value)
        },
    }
}